package com.woniuxy.controller;

import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.entity.User;
import com.woniuxy.service.ManagerLoginService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author：jojo
 * @Date：2022/2/23 19:25
 * @Description :TODO
 */
@RestController
@RequestMapping("/abc")
public class ManagerLogin {
    @Autowired(required = false)
    ManagerLoginService managerLoginService;


    @ApiOperation(value = "登陆方法")
    @RequestMapping("/login")
    public ResponseEntity login(@RequestBody User user){
        //登录成功后，需要生成token返回给前端
        System.out.println(user.toString());
        return managerLoginService.login(user);
    }
}
